﻿using System.Linq;

namespace FitnessHelperDB
{
  public partial class FoodIntakes
  {
    public double Calories
    {
      get { return FoodPortions.Sum(foodPortion => foodPortion.Amount * foodPortion.Foods.Calories); }
    }

    public double Proteins
    {
      get { return FoodPortions.Sum(foodPortion => foodPortion.Amount * foodPortion.Foods.Proteins); }
    }

    public double Carbohydrates
    {
      get { return FoodPortions.Sum(foodPortion => foodPortion.Amount * foodPortion.Foods.Carbohydrates); }
    }

    public double Fats
    {
      get { return FoodPortions.Sum(foodPortion => foodPortion.Amount * foodPortion.Foods.Fats); }
    }
  }
}
